<?php
/**
 * Joomla! 1.5 component JoomGPSTracks
 *
 * @version $Id: view.html.php 2009-06-24 15:40:19 svn $
 * @author Michael Pfister
 * @package joomGPStracks
 * @subpackage backend
 * @license GNU/GPL
 * @filesource
 *
 */

// no direct access
defined('_JEXEC') or die('Restricted access');

// Import Joomla! libraries
jimport( 'joomla.application.component.view');

/**
 *
 */
class JoomgpstracksViewComments extends JView {
    /**
     *
     * @param object $tpl
     */
    function display($tpl = null) {
        global $mainframe, $option;

        if($this->getLayout() == 'form'):
            $this->_displayForm($tpl);
            return;
        endif;
        
	$model =& $this->getModel();
        $rows =& $this->get( 'Data');
	$total	= & $this->get( 'Total');
        $pagination = & $this->get( 'Pagination' );

        $this->assignRef('lists',	$lists);
        $this->assignRef( 'rows',   $rows);
        $this->assignRef('pagination',	$pagination);
        
        parent::display($tpl);
    }

    function _displayForm($tpl)  {

        $cid = JRequest::getVar( 'cid', array(), 'post', 'array' );
        JArrayHelper::toInteger($cid);
        
        $model = $this->getModel();
        $comment = $model->getComment($cid);
        $editor =& JFactory::getEditor();

        $this->assignRef('comment',     $comment);
        $this->assignRef('editor',      $editor);

        parent::display($tpl);
    }
}
?>